package com.csun.cmny.provider.controller.message;

import com.csun.cmny.core.support.BaseController;
import com.csun.cmny.provider.dto.OrderQueryDto;
import com.csun.cmny.util.wrapper.WrapMapper;
import com.csun.cmny.util.wrapper.Wrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-10-11 18:41
 * @Description: the class omc message controller
 */
@RestController
@RequestMapping(value = "/message", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class OmcMessageController extends BaseController {

    @Autowired
    private CurTaskQueryHolder curTaskQueryHolder;

    /**
     * 根据用户身份查询待办事项
     */
    @PostMapping(value = "/queryToDoList")
    public Wrapper queryToDoList() {

        Object object = curTaskQueryHolder.queryToDoList(getLoginAuthDto());

        return WrapMapper.ok(object);
    }

    /**
     * 查询订单列表
     */
    @PostMapping(value = "/queryOrderList")
    public Wrapper queryOrderList(@RequestBody OrderQueryDto orderQueryDto) {

        Object object = curTaskQueryHolder.queryOrderList(orderQueryDto, getLoginAuthDto());

        return WrapMapper.ok(object);
    }

}
